package com.runda.partypolicy.app.page.fragment.home;



import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.resource.bitmap.CenterCrop;
import com.bumptech.glide.load.resource.bitmap.RoundedCorners;
import com.bumptech.glide.request.RequestOptions;
import com.runda.partypolicy.R;
import com.runda.partypolicy.app.base.BaseFragment;
import com.runda.partypolicy.app.page.viewmodel.ViewModel_Main_Mine;

import androidx.lifecycle.ViewModelProviders;
import butterknife.BindView;

/**
 *
 */
public class Fragment_Main_Mine extends BaseFragment<ViewModel_Main_Mine> {


    @BindView(R.id.iv_photo)
    ImageView ivPhoto;
    @BindView(R.id.commen_title_back)
    ImageView commenTitleBack;
    @BindView(R.id.commen_title_name)
    TextView commenTitleName;
    @BindView(R.id.commen_title_img)
    ImageView commenTitleImg;
    @BindView(R.id.commen_title_start)
    ImageView commenTitleStart;
    @BindView(R.id.commen_search_img)
    ImageView commenSearchImg;

    @BindView(R.id.iv_propertymgt)
    TextView ivPropertymgt;
    @BindView(R.id.iv_phone)
    TextView ivPhone;
    @BindView(R.id.iv_email)
    TextView ivEmail;
    @BindView(R.id.iv_collect)
    ImageView ivCollect;
    @BindView(R.id.iv_shop)
    ImageView ivShop;
    @BindView(R.id.iv_update)
    ImageView ivUpdate;


    public Fragment_Main_Mine() {
        // Required empty public constructor
    }

    public static Fragment_Main_Mine newInstance() {

        Bundle args = new Bundle();

        Fragment_Main_Mine fragment = new Fragment_Main_Mine();
        fragment.setArguments(args);
        return fragment;
    }
//
//    @OnClick(value = {R.id.mine_my_toliate})
//    public void onClick(View v) {
//    }

    @Override
    public int getLayout() {
        return R.layout.fragment_mine;
    }

    @Override
    public ViewModel_Main_Mine initViewModel() {
        return ViewModelProviders.of(this,getViewModelFactory()).get(ViewModel_Main_Mine.class);
    }

    @Override
    public void initEvents() {

    }

    @Override
    public void start() {
        commenTitleImg.setVisibility(View.GONE);
        Glide.with(getActivity()).load(R.drawable.icon_defaulet_photo)
                .apply(new RequestOptions().centerCrop().placeholder(R.drawable.icon_defaulet_photo))
                .apply(new RequestOptions().transforms(new CenterCrop(), new RoundedCorners(20)))
                .into(ivPhoto);

//        RequestOptions mRequestOptions = RequestOptions.circleCropTransform()
//                .diskCacheStrategy(DiskCacheStrategy.NONE)//不做磁盘缓存
//                .skipMemoryCache(true);//不做内存缓存
//
//        Glide.with(getActivity()).load(R.mipmap.icon_demo).apply(mRequestOptions).into(ivPhoto);

    }

    @Override
    public void initNotSignEvent() {

    }

    @Override
    public void initNoNetworkEvent() {

    }

    @Override
    public void initShowMessageEvent() {

    }

    @Override
    public void initTokenOverTimeEvent() {

    }

    @Override
    public void initShowOrDismissWaitingEvent() {

    }

    @Override
    public void initStateLayoutEvent() {

    }




}
